using System.Collections.Generic;
using FireStarter.CodeGeneration.Generator;
using FireStarter.CodeGeneration.Parser;

namespace FireStarter.CodeGeneration.Parser
{
    public class ValueExpressionParser : IActionParser
    {
        public TemplateExpression Parse(ref string templateText, List<IActionParser> actionParsers)
        {
            string propertyName = templateText.Substring(1);
            propertyName = propertyName.Trim();
            ValueExpression valueExpression = new ValueExpression(propertyName);
            templateText = "";
            return valueExpression;
        }

        public bool IsExpressionMatch(string text)
        {
            return text != null && text.StartsWith("=");
        }
    }
}